<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <META name="Keywords" content="yime,易米,二手,商品,学生,华软,电子商务,闲置物品,实名认证" />
    <META NAME="Description" CONTENT="专为大学生圈子定制的二手交易平台，实名认证网站，绿色环保，闲置物品出售和赠送。" />
    <title>易米网-专为大学生定制的实名二手交易网</title>
    <link rel="stylesheet" href="<?php echo base_url('public/css/guide.css') ?>" type="text/css" />
    <!-- jQuery -->
    <script type="text/javascript" src="<?php echo base_url('public/jquery/jquery-1.8.3.min.js') ?>"></script>

    <!--[if lt IE 9]>  
        <script src="<?php echo base_url('public/compatible/html5.js') ?>"></script>  
    <![endif]-->  
    
	<!-- iealert -->
	<script src="<?php echo base_url('public/iealert/iealert.js') ?>" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/iealert/style.css') ?>"/>
        <script type="text/javascript">
            $(document).ready(function () {
                $("body").iealert();
            });
    </script>

    <!-- Bootstrap -->
    <script type="text/javascript" src="<?php echo base_url('public/libraries/bootstrap/js/bootstrap.min.js') ?>"></script>
    <link href="<?php echo base_url('public/libraries/bootstrap/css/bootstrap.min.css') ?>" rel="stylesheet" type="text/css"/>

    <!-- jQuery UI -->
    <script type="text/javascript" src="<?php echo base_url('public/jquery-ui-1.10.4/jquery-ui.min.js') ?>"></script>
    <link href="<?php echo base_url('public/jquery-ui-1.10.4/yime-theme/jquery-ui-1.10.4.custom.css') ?>" rel="stylesheet" type="text/css"/>

    <!-- jquery-validation -->
    <script type="text/javascript" src="<?php echo base_url('public/libraries/jquery-validation-1.11.1/jquery.validate.min.js') ?>"></script>
    <script type="text/javascript" src="<?php echo base_url('public/libraries/jquery-validation-1.11.1/localization/messages_zh.js') ?>"></script>

    <!-- Noty -->
    <script type="text/javascript" src="<?php echo base_url('public/libraries/noty-2.2.2/packaged/jquery.noty.packaged.min.js') ?>"></script>
    <script type="text/javascript" src="<?php echo base_url('public/libraries/noty-2.2.2/options.js') ?>"></script>

    <!-- tapmodo-Jcrop-v0.9.12 -->
    <script type="text/javascript" src="<?php echo base_url('public/tapmodo-Jcrop-v0.9.12/js/jquery.Jcrop.min.js') ?>"></script>
    <link href="<?php echo base_url('public/tapmodo-Jcrop-v0.9.12/css/jquery.Jcrop.min.css') ?>" rel="stylesheet" type="text/css"/>

    <!-- jQuery sha1 -->
    <script type="text/javascript" src="<?php echo base_url('public/libraries/jquery.sha1/jquery.sha1-min.js') ?>"></script>

    <!-- jQuery pin -->
    <script type="text/javascript" src="<?php echo base_url('public/libraries/jquery.pin/jquery.pin.js') ?>"></script>

    <!-- guide.js -->
    <script type="text/javascript" src="<?php echo base_url('public/js/guide.js') ?>"></script>

    <!-- jquery.placeholder.js 兼容ie8一下的html5的placeholder属性-->

    <!-- autocomplete 自动完成插件-->
    <script type="text/javascript" src="<?php echo base_url('public/libraries/autocomplete/jquery.autocomplete.js') ?>"></script>
    <script type="text/javascript" src="<?php echo base_url('public/libraries/autocomplete/autocomplete.email.js') ?>"></script>
    <link href="<?php echo base_url('public/libraries/autocomplete/jquery.autocomplete.css') ?>" type="text/css" rel="stylesheet" />

    <script>
        function base_url(url) {
            return '<?php echo base_url()?>' + url;
        }
    </script>
</head>
<body>
<a href="index.html" class="logo"><img src="<?php echo base_url('public/images/guide/logo.png') ?>"></a>
<div class="hei_bg"></div>
<div id="welcome" class="current">
    <div class="container">
        <div id="heads">
            <div class="yizai"><img src="<?php echo base_url('public/images/guide/yizai.png') ?>"></div>
            <div id="illia_1">
                <form id="testform" method="post">
                    <h3><img src="<?php echo base_url('public/images/guide/login_box_bg-top.png') ?>"></h3>
                    <div class="guide-regiter">
                        <div class="input-group">
                            <input type="email" name="register_name" id="register-name" class="form-control" minlength="3" maxlength="30" required="required" placeholder="请填写你的邮箱"/>
                        </div>
                        <div class="input-group">
                            <input type="password" name="register_password" id="register-password" class="form-control" minlength="6" maxlength="30" required="required" placeholder="请填写你的密码"/>
                        </div>
                        <div class="input-group">
                            <input type="text" name="register_captcha" id="register-captcha" class="form-control" minlength="4" maxlength="30" required="required" placeholder="请填写验证码" style="width:180px;"/>
                            <div class="register-captcha-img">
                                <?php if (isset($captcha) && isset($captcha['image'])) echo $captcha['image']; ?>
                            </div>
                            <div class="clearfix"></div>
                            <div class="input-group">
                                <input type="submit" class="btn-success form-control" id="a" value="注册"/>
                            </div>
                            <div class="input-group2">
                                <span style="color:#E75632; line-height:30px; float: left; height: 28px; line-height: 28px; font-size: 12px;">快速注册：</span>
                                <a href="<?php echo $weibologin ?>" id="WB-login" title="新浪微博登陆">微博注册</a>
                                <span class="now-login"><a class="signIn" href="javascript:void (0)">已有账号？立即登录</a></span>
                            </div>
                        </div>
                    </div>
                </form>
                <form id="login-form">
                    <div class="guide-login">
                        <div class="input-group">
                            <input type="email" name="login_name" id="login-name" class="form-control" minlength="3" maxlength="30" required="required" placeholder="邮箱账号"/>
                        </div>
                        <div class="input-group">
                            <input type="password" name="login_password" id="login-password" class="form-control" maxlength="30" required="required" placeholder="密码"/>
                        </div>
                        <div class="input-group">
                            <div style="margin-top:10px; margin-left: -20px; font-size:12px; color:#828282">
                                <span><input type="checkbox" checked="checked" name="login-auto" id="login-auto" style="margin: 0 4px 0 0; vertical-align: -2px;"/><label for="login-auto" style="cursor: pointer"> 下次自动登陆</label></span>
                                <span style="float: right; margin-right: 20px;"><a class="forgetPassword" href="<?php echo base_url('home/resetpwd') ?>">忘记密码？</a></span>
                            </div>
                            <div class="input-group">
                                <input type="submit" class="btn-success form-control" id="" value="登陆"/>
                            </div>
                            <div class="input-group2">
                                <span style="color:#E75632; line-height:30px; float: left; height: 28px; line-height: 28px; font-size: 12px;">快速登陆：</span>
                                <a href="<?php echo $weibologin ?>" id="WB-login" title="新浪微博登陆">微博登陆</a>
                                <span class="now-regiter"><a class="signIn" href="javascript:">没有账号？立即注册</a></span>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <a href="<?php echo base_url() ?>" id="totop"> </a>
            <a href="<?php echo base_url('home/skip_userguide') ?>" id="masha_and_tim_1"> </a>
            <a href="<?php echo base_url('home/aboutus') ?>" id="vika_1" target="_blank"> </a>
            <a href="#" id="fred_1"> </a>
            <div class="cb"></div>
        </div>
        <a href="javascript:void(0)" class="down"> </a>
        <div id="activity">
            <div id="icon1"><img src="<?php echo base_url('public/images/guide/icon_eat.png') ?>"><span>操作简捷</span></div>
            <div id="icon4"><img src="<?php echo base_url('public/images/guide/icon_drink.png') ?>"><span>实名认证</span></div>
            <div id="icon3"><img src="<?php echo base_url('public/images/guide/icon_coffee.png') ?>"><span>环保信任</span></div>
            <div id="icon5"><img src="<?php echo base_url('public/images/guide/icon_walk.png') ?>"><span>全国校联</span></div>
            <div id="icon6"><img src="<?php echo base_url('public/images/guide/icon_sport.png') ?>"><span>易物交友</span></div>
            <p class="p1"><img src="<?php echo base_url('public/images/guide/p1.png') ?>"/></p>
            <p class="p2"><img src="<?php echo base_url('public/images/guide/p2.png') ?>"/></p>
            <p class="p3"><img src="<?php echo base_url('public/images/guide/p3.png') ?>"/></p>
            <p class="p4"></p>
        </div>
        <a href="javascript:void(0)" class="down2 down1"> </a>
        <a href="javascript:void(0)" class="top2 top"> </a>
        <div id="san">
            <img class="title3" src="<?php echo base_url('public/images/guide/title3.png') ?>">
            <div class="san_left">
                <img class="yizai2" src="<?php echo base_url('public/images/guide/yizai2.png') ?>">
                <img class="chat1" src="<?php echo base_url('public/images/guide/chat1.png') ?>">
                <img class="sdut1" src="<?php echo base_url('public/images/guide/sdut1.png') ?>">
                <img class="chat2" src="<?php echo base_url('public/images/guide/chat2.png') ?>">
                <img class="yizai3" src="<?php echo base_url('public/images/guide/yizai2.png') ?>">
                <img class="chat3" src="<?php echo base_url('public/images/guide/chat3.png') ?>">
            </div>
            <div class="san_right">
                <img class="computer" src="<?php echo base_url('public/images/guide/computer.png') ?>">
                <img class="bicycle" src="<?php echo base_url('public/images/guide/bicycle.png') ?>">
                <img class="sell" src="<?php echo base_url('public/images/guide/sell.png') ?>">
            </div>
            <a href="javascript:void(0)" class="down3 down1" style="z-index:302"></a>
            <a href="javascript:void(0)" class="top3 top" style="z-index:302"> </a>
        </div>
        <div id="si">
            <img class="title4" src="<?php echo base_url('public/images/guide/title4.png') ?>">
            <div class="san_left">
                <img class="sdut2" src="<?php echo base_url('public/images/guide/sdut2.png') ?>">
                <img class="chat4" src="<?php echo base_url('public/images/guide/chat4.png') ?>">
                <img class="yizai4" src="<?php echo base_url('public/images/guide/yizai2.png') ?>">
                <img class="chat5" src="<?php echo base_url('public/images/guide/chat5.png') ?>">
                <img class="sdut3" src="<?php echo base_url('public/images/guide/sdut2.png') ?>">
                <img class="chat6" src="<?php echo base_url('public/images/guide/chat6.png') ?>">
            </div>
            <div class="san_right">
                <img class="book" src="<?php echo base_url('public/images/guide/book.png') ?>">
                <img class="sell2" src="<?php echo base_url('public/images/guide/sell2.png') ?>">
            </div>
            <a href="javascript:void(0)" class="down4 down1" style="z-index:303"></a>
            <a href="javascript:void(0)" class="top4 top" style="z-index:303"></a>
        </div>
        <div id="wu">
            <div class="hei_bg2"></div>
            <div class="wu_con">
                <img class="zhixie" src="<?php echo base_url('public/images/guide/zhixie.png') ?>">
                <div class="cb"></div>
                <img class="txt" src="<?php echo base_url('public/images/guide/txt.png') ?>">
            </div>
            <a href="javascript:void(0)" class="top5 top" style="z-index:303"></a>
        </div>
    </div>
    <div class="school">
        <div class="BG"></div>
        <div class="school_box">
            <h3>
                <img src="<?php echo base_url('public/images/guide/school1.png') ?>"/>
                <div class="school_close"></div>
            </h3>
            <ul>
                <li>广州大学华软软件学院</li>
                <li>中山大学南方学院</li>
                <li>广东财经大学</li>
                <li>华南农业大学珠江学院</li>
                <li>广州大学</li>
                <li>广东水利电力职业技术学院</li>
                <div class="cb"></div>
            </ul>
            <div class="txt_box">
                <p>如果你希望我们能兼容到你的学校，可以提交意见给我们的工程师哦！</p>
                <form>
                    <textarea class="school_txt">请填入你的学校名称或建议</textarea>
                    <input type="button" value="提交">
                </form>
            </div>
        </div>
    </div>
</div>

</body>
</html>
<script>
    $(function () {
        $.AutoComplete('#register-name');
        $.AutoComplete('#login-name');

        $('.register-captcha-img').click(function () {
            $.getJSON('<?php echo base_url('api/getCaptcha');?>', function (rsp) {
                try {
                    switch (rsp.type) {
                        case 'success':
                            $('.register-captcha-img').html(rsp.data);
                            break;
                        default :
                            noty({type: rsp.type, text: rsp.message});
                            break;
                    }
                } catch (ex) {
                    noty({type: 'error', text: '发生内部错误，请联系管理员'});
                    throw ex;
                }
            });
        });

        //注册
        $("#testform").validate({
            submitHandler: function (form) {
                $.ajax({
                    url: '<?php echo base_url('api/register');?>',
                    type: 'post',
                    data: $(form).serialize(),
                    beforeSend:function(){
                        showProgressNoty();
                    },
                    complete: function () {
                        closeProgressNoty();
                    },
                    success: function (jsonrsp) {
                        try {
                            var rsp = $.parseJSON(jsonrsp);
                            noty({type: rsp.type, text: rsp.message, callback: {
                                afterClose: function () {
                                    switch (rsp.type) {
                                        case 'success':
                                            noty({
                                                type:'warning',
                                                text:'邮件已发送至您邮箱，现在去激活吗？',
                                                buttons: [
                                                    {
                                                        addClass: 'btn btn-sm btn-danger', text: '确定',
                                                        onClick: function ($noty) {
                                                            $noty.close();
                                                            window.location.href=rsp.mail_url;
                                                        }
                                                    },
                                                    {
                                                        addClass: 'btn btn-sm btn-default', text: '取消',
                                                        onClick: function ($noty) {
                                                            $noty.close();
                                                            location.reload();
                                                        }
                                                    }
                                                ]
                                            });
                                            break;
                                        case 'fail':
                                            noty({type:'error',text:'邮件发送失败，请联系管理员！'});
                                        default:
                                            break;
                                    }
                                }
                            }});
                        } catch (ex) {
                            noty({type: 'error', text: '发生内部错误，请联系管理员'});
                            throw ex;
                        }
                    }
                });
            }
        });

        //登录
        $("#login-form").validate({
            submitHandler: function (form) {
                $.ajax({
                    url: '<?php echo base_url('api/login');?>',
                    type: 'post',
                    data: $(form).serialize(),
                    beforeSend: function () {
                        showProgressNoty();
                    },
                    complete: function () {
                        closeProgressNoty();
                    },
                    success: function (jsonrsp) {
                        try {
                            var rsp = $.parseJSON(jsonrsp);
                            noty({type: rsp.type, text: rsp.message, callback: {
                                afterClose: function () {
                                    switch (rsp.type) {
                                        case 'success':
                                            location.href=base_url('home/changeschool/'+rsp.data.schoolunicode);
                                            break;
                                        case 'alert':
                                            window.location.href=base_url('home/binduser');
                                            break;
                                        default:
                                            break;
                                    }
                                }
                            }});
                        } catch (ex) {
                            noty({type: 'error', text: '发生内部错误，请联系管理员'});
                            throw ex;
                        }
                    }
                });
            }
        });

    });

    var $progressNoty;

    function showProgressNoty() {
        $progressNoty = noty({text: '<div id="progress-noty" class="progress progress-striped active" style="margin:0"><div class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div></div>', timeout: 0});
    }

    function changeProgressNoty(percent) {
        $('#progress-noty').find('.progress-bar').css('width', percent + '%');
    }

    function closeProgressNoty() {
        $progressNoty.close();
    }
</script>

<script>
    var oForm1 = document.getElementById('testform');
    var oForm1Inputs = oForm1.getElementsByTagName('input');
    for(var i=0;i<oForm1Inputs.length;i++){
        placeHolder(oForm1Inputs[i],true);
    }
    var oForm1Textarea = oForm1.getElementsByTagName('textarea')[0];
    placeHolder(oForm1Textarea,true);
    /**
     * @name placeHolder
     * @class 跨浏览器placeHolder,对于不支持原生placeHolder的浏览器，通过value或插入span元素两种方案模拟
     * @param {Object} obj 要应用placeHolder的表单元素对象
     * @param {Boolean} span 是否采用悬浮的span元素方式来模拟placeHolder，默认值false,默认使用value方式模拟
     */
    function placeHolder(obj, span) {
        if (!obj.getAttribute('placeholder')) return;
        var imitateMode = span===true?true:false;
        var supportPlaceholder = 'placeholder' in document.createElement('input');
        if (!supportPlaceholder) {
            var defaultValue = obj.getAttribute('placeholder');
            if (!imitateMode) {
                obj.onfocus = function () {
                    (obj.value == defaultValue) && (obj.value = '');
                    obj.style.color = '';
                }
                obj.onblur = function () {
                    if (obj.value == defaultValue) {
                        obj.style.color = '';
                    } else if (obj.value == '') {
                        obj.value = defaultValue;
                        obj.style.color = '#ACA899';
                    }
                }
                obj.onblur();
            } else {
                var placeHolderCont = document.createTextNode(defaultValue);
                var oWrapper = document.createElement('span');
                oWrapper.style.cssText = 'position:absolute; color:#ACA899; display:inline-block; overflow:hidden;';
                oWrapper.className = 'wrap-placeholder';
                oWrapper.style.fontFamily = getStyle(obj, 'fontFamily');
                oWrapper.style.fontSize = getStyle(obj, 'fontSize');
                oWrapper.style.marginLeft = parseInt(getStyle(obj, 'marginLeft')) ? parseInt(getStyle(obj, 'marginLeft')) + 3 + 'px' : 3 + 'px';
                oWrapper.style.marginTop = parseInt(getStyle(obj, 'marginTop')) ? getStyle(obj, 'marginTop'): 1 + 'px';
                oWrapper.style.paddingLeft = getStyle(obj, 'paddingLeft');
                oWrapper.style.width = obj.offsetWidth - parseInt(getStyle(obj, 'marginLeft')) + 'px';
                oWrapper.style.height = obj.offsetHeight + 'px';
                oWrapper.style.lineHeight = obj.nodeName.toLowerCase()=='textarea'? '':obj.offsetHeight + 'px';
                oWrapper.appendChild(placeHolderCont);
                obj.parentNode.insertBefore(oWrapper, obj);
                oWrapper.onclick = function () {
                    obj.focus();
                }
                //绑定input或onpropertychange事件
                if (typeof(obj.oninput)=='object') {
                    obj.addEventListener("input", changeHandler, false);
                } else {
                    obj.onpropertychange = changeHandler;
                }
                function changeHandler() {
                    oWrapper.style.display = obj.value != '' ? 'none' : 'inline-block';
                }
                /**
                 * @name getStyle
                 * @class 获取样式
                 * @param {Object} obj 要获取样式的对象
                 * @param {String} styleName 要获取的样式名
                 */
                function getStyle(obj, styleName) {
                    var oStyle = null;
                    if (obj.currentStyle)
                        oStyle = obj.currentStyle[styleName];
                    else if (window.getComputedStyle)
                        oStyle = window.getComputedStyle(obj, null)[styleName];
                    return oStyle;
                }
            }
        }
    }
</script>
<script>
    $(function () {
        $(".signIn").click(function(){
            $(".guide-login").css("display","none");
            $(".guide-regiter").css("display","block");
        })
        $(".now-login").on("click",function(){
            $(".guide-login").css("display","block");
            $(".guide-regiter").css("display","none");
        })
    })
</script>

